home *** CD-ROM | disk | FTP | other *** search
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- #include "shared.fx"
- #include "lighting.fx"
- #define FOG_DISABLE
- #include "fog.fx"
-
- //------------------------------------------------------------------------------------------------------
- //- Static parameters
- //------------------------------------------------------------------------------------------------------
-
- texture DiffuseMap;
- float4 FadeFactor; //shared between all occurences of this shader.
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- struct GUIFadeVertexShaderInput
- {
- float4 Position : POSITION;
- float2 DiffuseUv : TEXCOORD0;
- };
-
- //------------------------------------------------------------------------------------------------------
-
- struct GUIFadeVertexShaderOutput
- {
- float4 Position : POSITION;
- float4 FadeFactor : COLOR0;
- float2 DiffuseUv : TEXCOORD0;
- FOG_OPTION_VERTEX_FIELD
- };
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- GUIFadeVertexShaderOutput GUIFadeVertexShaderTech1Pass1(const GUIFadeVertexShaderInput input);
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- GUIFadeVertexShaderOutput GUIFadeVertexShaderTech1Pass1(const GUIFadeVertexShaderInput input)
- {
- GUIFadeVertexShaderOutput output;
-
- // output position into world+view+projection space
- output.Position = mul (input.Position,WorldCameraProjection);
-
- // Diffuse Uv output
- output.DiffuseUv = input.DiffuseUv;
-
- // use color0 to store the fade factor.
- output.FadeFactor = FadeFactor;
-
- FOG_OPTION_COMPUTE(output, output.Position);
-
- return output;
- }
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- technique Fade
- <
- int Priority = 0;
- int NeedSorting = 1;
- int TechniqueIndex = 0;
- int DeviceType = HWSHADER_ONLY;
- int LightingType = INTEGRATED_LIGHTING;
- string RenderingType = "Standard";
- >
- {
- pass pass1
- {
- Texture[0] = <DiffuseMap>;
- MinFilter[0] = LINEAR;
- MagFilter[0] = LINEAR;
- MipFilter[0] = LINEAR;
- AddressU[0] = WRAP;
- AddressV[0] = WRAP;
- CullMode = CW;
- ZEnable = true;
- ZFunc = LESSEQUAL;
- ZWriteEnable = false;
-
- AlphaTestEnable = false;
- AlphaBlendEnable = true;
-
- SrcBlend = SRCALPHA;
- DestBlend = SRCCOLOR;
-
- FOG_OPTION_PARAMETERS;
-
- //SrcBlend = ZERO;
- //DestBlend = INVSRCCOLOR;
- //SrcBlend = SRCCOLOR;
- //DestBlend = INVSRCCOLOR;
-
- VertexShader = compile vs_1_1 GUIFadeVertexShaderTech1Pass1();
-
- PixelShader =
- asm
- {
- ps_1_1
-
- tex t0 // Diffuse map
-
- mul_sat r1, t0 , 1-t0
- mul_x4_sat r0, 1-r1, t0
- mul_sat r0, 1-r0, v0.a
- mov r0.rgb, 1-r0 + mul r0.a, t0.a, v0.a
- };
- }
- }
-
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- /*
- technique DecalLightVersion
- <
- int Priority = 0;
- int NeedSorting = 1;
- int TechniqueIndex = 2;
- int DeviceType = HWSHADER_ONLY;
- int LightingType = INTEGRATED_LIGHTING;
- string RenderingType = "Standard";
- >
- {
- pass pass1
- {
- Texture[0] = <DiffuseMap>;
- MinFilter[0] = LINEAR;
- MagFilter[0] = LINEAR;
- MipFilter[0] = LINEAR;
- AddressU[0] = WRAP;
- AddressV[0] = WRAP;
- CullMode = CW;
- ZEnable = true;
- ZFunc = LESSEQUAL;
- ZWriteEnable = false;
-
- AlphaTestEnable = false;
- AlphaBlendEnable = false;
-
- SrcBlend = SRCALPHA;
- DestBlend = INVSRCALPHA;
-
- FOG_OPTION_PARAMETERS;
-
- VertexShader = compile vs_1_1 GUIFadeVertexShaderTech1Pass1();
-
- PixelShader =
- asm
- {
- ps_1_1
-
- tex t0 // Diffuse map
-
- //mul r1, t0, 1-t0
- //mul_x4 r0, 1-r1, t0
- //mul r0, 1-r0, v0.a
- //mov r0.rgb, 1-r0 + mul r0.a, t0.a, v0.a
-
- mul_d2 r0, t0, 1-t0
- // mul r1, 1-r1, r1
- // mul r1, 1-r1, r1
- // mul r0, 1-r1, r1
-
- //mov r0, t0
- };
- }
- }
- */
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- technique techTnL_0
- <
- int Priority = 1;
- int TechniqueIndex = 0;
- int DeviceType = TNL_ONLY;
- int LightingType = INTEGRATED_LIGHTING;
- string RenderingType = "Standard";
- >
- {
- pass pass1
- {
- WorldTransform[0] = <WorldCameraProjection>;
-
- Texture[0] = <DiffuseMap>;
-
- ColorArg1[0] = TEXTURE;
- ColorOp[0] = SELECTARG1;
- AlphaArg1[0] = TEXTURE;
- AlphaOp[0] = SELECTARG1;
-
- ColorOp[1] = DISABLE;
- AlphaOp[1] = DISABLE;
-
- MinFilter[0] = LINEAR;
- MagFilter[0] = LINEAR;
- MipFilter[0] = LINEAR;
-
- AddressU[0] = WRAP;
- AddressV[0] = WRAP;
-
- CullMode = CW;
- ZEnable = true;
- ZFunc = LESSEQUAL;
- ZWriteEnable = true;
- AlphaBlendEnable = false;
- AlphaTestEnable = true;
- AlphaRef = 192;
- AlphaFunc = GREATEREQUAL;
-
- VertexShader = NULL;
- PixelShader = NULL;
- }
- }
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
- #include "mesh_shadow.fx"
- #include "mesh_shadow_projector.fx"
-
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
- //------------------------------------------------------------------------------------------------------
-
-